<!DOCTYPE html>
<html lang="en">

<head>
    <style>
        html{height: 100%;}
        body {
            margin: 0;
            height: 100%;
            padding: 0;
       overflow: hidden; }
        
        main {
            height: 100%;
            position: relative;
        transform-style: preserve-3d; 
        perspective: 10000px;
        /*perspective-origin设置观察者角度，（调整xy值 默认值50%，50%）*/
          animation:  dong 5s  linear  infinite; }
        
        div {
            width: 300px;
            height: 300px;
            position: absolute;
            background-size: 100% 100%;
            left: calc(50% - 300px/2);
            top: calc(50% - 300px/2);
            /*设置3d转换的参考点*/
           /*transform-origin:50%  50%  0; */
           /*left: 500px;
           top: 150px;*/
        }
        @keyframes dong{
            0%{transform: rotateX(0deg) rotatey(0deg) rotatez(0deg);}
  100%{transform: rotateX(360deg) rotatey(360deg) rotatez(360deg);} }
        
        div:nth-child(1) {
            background-image: url(图片/1.jpg);
        transform: translatey(-150px) rotateX(90deg);}
        
        div:nth-child(2) {
            background-image: url(图片/2.jpg);
       transform: translatey(150px) rotateX(90deg); }
        
        div:nth-child(3) {
            background-image: url(图片/3.jpg);
      transform: translatex(-150px) rotatey(90deg);  }
        
        div:nth-child(4) {
            background-image: url(图片/4.jpg);
             transform: translatex(150px) rotatey(90deg);  }
        
        div:nth-child(5) {
            background-image: url(图片/5.jpg);
       transform: translateZ(150px); }
        
        div:nth-child(6) {
            background-image: url(图片/6.jpg);
            transform: translateZ(-150px); }
    </style>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>立方体</title>
    <link rel="stylesheet" href="立方体.css">

</head>

<body>
    <main>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
    </main>

</body>

</html>